<?php
namespace app\admin\logic;

use app\admin\model\SiteConfigModel;
use app\admin\model\SystemModel;
use think\Cache;
use think\Config;

class SiteConfigLogic extends BaseLogic
{
    /**
     * 获取当前网站设置
     */
    public function get_site_config(){
        $config = Cache::get('system');
        if($config === false){
            $model = new SiteConfigModel();
            $data = $model->get_site_config();
            foreach ($data as $value){
                $config[$value['alias']] = $value['value'];
            }
            Cache::set('site',$config);
        }
        Config::set('site',$config);
    }

}
